package com.yz.smartpos.yztester.util;

import com.yz.smartpos.yztester.ui.ResultFragment;

import java.io.Serializable;

public class TestCase implements Serializable {
//    private int id;
    public int index1;
    public int index2;
    public int index3;
    public String lastestRuntime = "";


    private String caseName;
    private String moduleName;
    private String mResultState = STATUS_NOTRUN;
    private int errCount;
    private String runType;

    private static ResultFragment Logger = ResultFragment.newInstance();
    public final static String TYPE_FUN = "FUN";
    public final static String TYPE_TOL = "TOL";
    public final static String TYPE_REL = "REL";
    public final static String TYPE_PER = "PER";
    public final static String TYPE_STR = "STR";
    public final static String TYPE_INT = "INT";
    public final static String TYPE_MUL = "MUL";

    public final static String AUTO = "AUTO";
    public final static String MANUAL = "MANUAL";
    //card AUTO：无卡  AUTO_rf：只有rf卡在位  AUTO_ic：只有ic卡在位
    public final static String AUTO_rf = "AUTO_rf";
    public final static String AUTO_ic = "AUTO_ic";
    public final static String AUTO_nocard = "AUTO_nocard";
    //scan， AUTO:无显码服务  AUTO_scan：需要显码服务
    public final static String AUTO_scan = "AUTO_scan";

    //printer， AUTO:无纸  AUTO_paper：有纸
    public final static String AUTO_paper = "AUTO_paper";

    public final static String STATUS_PASSED = "o ";  //PASSED
    public final static String STATUS_FAILED = "x ";  //FAILED
    public final static String STATUS_NOTRUN = ""; //NOTRUN
    public final static String STATUS_NOTFOUND = "m"; //NOTRUN


    public TestCase(String caseName) {
        this.caseName = caseName;
        this.mResultState = STATUS_NOTRUN;
        this.index1 = 0;
        this.index2 = 0;
        this.index3 = 0;
        this.errCount = 0;
    }

    public TestCase(int index1, int index2, String moduleName, String caseName, String runType) {
        this.moduleName = moduleName;
        this.caseName = caseName;
        this.mResultState = STATUS_NOTRUN;
        this.index1 = index1;
        this.index2 = index2;
        this.index3 = 0;
        this.errCount = 0;
        this.runType = runType;
    }

    public void setCaseName(String caseName) {
        this.caseName = caseName;
    }

    public String getCaseName() {
        return caseName;
    }

    public void setModuleName(String moduleName) {
        this.moduleName = moduleName;
    }

    public String getModuleName() {
        return moduleName;
    }

    public String getmResultState() {
        return mResultState;
    }

    public void setmResultState(String mResultState) {
        this.mResultState = mResultState;
    }

    public int getErrCount() {
        return this.errCount;
    }

    public void setErrCount(int cnt) {
        this.errCount = cnt;
        Logger.showTitle(this.caseName+"("+cnt+")");
    }

    public String getRunType() { return runType; }


}
